import request from '@/utils/request'
import { encryptedData } from '@/utils/encrypt'
import { loginRSA, tokenName } from '@/config'

export async function login(data) {
  /*if (loginRSA) {
    data = await encryptedData(data)
  }*/
  return request({
    url: '/presoftasim/auth/login',
    method: 'post',
    data,
  })
}

export function getUserInfo(accessToken) {
  return request({
    url: '/presoftasim/system/user/getCurrentUserInfo',
    method: 'post',
    params: { token: accessToken },
  })
}

export function logout(token) {
  return request({
    url: '/presoftasim/auth/logout',
    method: 'post',
    params: { token: token },
  })
}

export function register() {
  return request({
    url: '/register',
    method: 'post',
  })
}
